package com.tdk.wifidirectserver

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.tdk.wifidirectserver.databinding.ActivityApconnectBinding
import com.tdk.wifidirectserver.databinding.ActivityEnterBinding
import com.tdk.wifidirectserver.ui.main.ConnectedClientFragment
import com.tdk.wifidirectserver.ui.main.ConnectedServerFragment
import com.tdk.wifidirectserver.ui.nsd.NsdClientFragment
import com.tdk.wifidirectserver.ui.nsd.NsdServerFragment

class APConnectActivity : AppCompatActivity() {
    lateinit var binding: ActivityApconnectBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityApconnectBinding.inflate(layoutInflater)
        setContentView(binding.root)
        initView()
    }

    private fun initView() {
        binding.btOpenServer.setOnClickListener {
            binding.llButtons.visibility = View.GONE
            supportFragmentManager.beginTransaction()
                .replace(R.id.container,NsdServerFragment())
                .commit()

        }

        binding.btOpenClient.setOnClickListener {
            binding.llButtons.visibility = View.GONE
            supportFragmentManager.beginTransaction()
                .replace(R.id.container, NsdClientFragment())
                .commit()

        }
    }
}